package com.business.java2cache.redis;

import com.business.java2cache.core.Cache;
import com.business.java2cache.core.CacheProvider;
import com.business.java2cache.util.CacheException;

import java.util.Properties;

/**
 * Redis 缓存实现
 */
public class RedisCacheProvider implements CacheProvider {

    public String name() {
        return "redis";
    }

    @Override
    public Cache buildCache(String regionName) throws CacheException {
        RedisCache cache = RedisCache.getInstance();
        return cache;
    }

    @Override
    public void start(Properties props) throws CacheException {
        RedisCache.getInstance();
    }

    @Override
    public void stop() {
        RedisCache.getInstance().pool.destroy();
    }


}
